package cn.edu.jxau.lang;

import net.sf.cglib.proxy.CallbackFilter;

import java.lang.reflect.Method;

/**
 * Desc:
 * ------------------------------------
 * Author:fulei04@meituan.com
 * Date:2017/12/21
 * Time:下午12:00
 */
public class AuthInterceptorFilter implements CallbackFilter {

    private static final int NOT_NEED_AUTH = 0; // 不需要权限
    private static final int NEED_AUTH = 1; // 需要权限

    @Override
    public int accept(Method method) {

        if("select".equals(method.getName())){
            return NOT_NEED_AUTH;
        }
        return NEED_AUTH;
    }
}
